//
//  LocationInfoModel.m
//  BaishidaiKnight
//
//  Created by mac book on 2019/1/24.
//  Copyright © 2019年 sy. All rights reserved.
//

#import "LocationInfoModel.h"

@implementation LocationInfoModel

- (id)initWithCoder:(NSCoder *)aDecoder
{
    self = [super init];
    if (self) {
        self.lat = [aDecoder decodeObjectForKey:@"lat"];
        self.lng = [aDecoder decodeObjectForKey:@"lng"];
        self.enabled = [[aDecoder decodeObjectForKey:@"enabled"] boolValue];
        return self;
    }else{
        return nil;
    }
}

- (void)encodeWithCoder:(NSCoder *)aCoder
{
    [aCoder encodeObject:self.lat forKey:@"lat"];
    [aCoder encodeObject:self.lng forKey:@"lng"];
    [aCoder encodeObject:[NSNumber numberWithBool:self.enabled] forKey:@"enabled"];
}

-(NSString *)lat{
    if([CommonUntils isNULLOrnil:_lat]){
        return @"";
    }
    return _lat;
}

-(NSString *)lng{
    if ([CommonUntils isNULLOrnil:_lng]) {
        return @"";
    }
    return _lng;
}


@end
